-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: including public channels should check for compliance settings #102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments and we're good to go! 🚀
btw you've also addressed this ticket with your work: https://mattermost.atlassian.net/browse/MM-59309
@@ -86,10 +82,6 @@ func (kvs Impl) GetLegalHoldByID(id string) (*model.LegalHold, error) { | |||
} | |||
|
|||
func (kvs Impl) UpdateLegalHold(lh, oldValue model.LegalHold) (*model.LegalHold, error) { | |||
if err := lh.IsValidForCreate(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would feel safer if we also kept the store level validation because we call this method from the job layer as well. We only call CreateLegalHold
from the api layer but maybe we should also keep that validation in the store layer to protect ourselves from future modifications?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right that we can reach this from the job layer, let me take a look at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Been checking the code, the job itself only updates one field currently outside of the scope of model.UpdateLegalHold
struct, and the code does not follow the same logic path.
Do you think it would add value to add this check here considering we are updating the value atomically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it just future proofs the code even if it doesn't make a difference right now. We do this in mattermost-server for a lot of our create/update store functions. @esarafianou what is our official stance on this? It's not entirely consistent in our server code either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's create a ticket for this an address for subsequent release. We are in the final stage of releasing this to several customers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #105
Summary
StartDate < EndDate
)Ticket Link
https://mattermost.atlassian.net/browse/MM-59830